IF(MSVC)

    SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2")
    #/Z7 将pdb合并到库文件 /Zi 生成单独的pdb文件
    SET(CMAKE_CXX_FLAGS_DEBUG "/Z7 /Ob0 /Od")
    SET(CMAKE_CXX_FLAGS "/EHsc /wd\"4819\" /wd\"4996\"")  
    
ENDIF()


IF(CMAKE_COMPILER_IS_GNUCXX)

    SET(CMAKE_CXX_FLAGS_RELEASE "-s -O3 -Os")
    SET(CMAKE_CXX_FLAGS_DEBUG  "-O0 -g -ggdb")
    SET(CMAKE_CXX_FLAGS
        "-Wall -Wno-unused-variable -Wno-reorder -Wno-unused-function")
    
    IF(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8)
    
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
        
    ENDIF()
    
ENDIF()